﻿using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using System.ComponentModel;

namespace HX.HxDemo.BOS.Business.PlugIn25011604
{
    [Description("【表单插件】AfterDeleteRow"),HotUpdate]
    public class AfterDeleteRowFormPlugIn : AbstractDynamicFormPlugIn
    {
        public override void AfterDeleteRow(AfterDeleteRowEventArgs e)
        {
            base.AfterDeleteRow(e);
            if (e.EntityKey.EqualsIgnoreCase("FPOOrderEntry"))
            {
                var msg = string.Format("{0}的第{1}行的数据已删除，物料名称：{2}，采购数量：{3}", this.View.BillBusinessInfo.GetEntity(e.EntityKey).Name
                    , e.Row + 1, e.DataEntity["MaterialId"] == null ? "" : ((DynamicObject)e.DataEntity["MaterialId"])["Name"], e.DataEntity["Qty"]);
                this.View.ShowMessage(msg);
            }
        }
    }
}
